/**
 * @author furthurr({})
 */

var win = Titanium.UI.currentWindow;
win.backgroundColor = 'white';
win.backgroundImage = '../imgs/WallMaestrias.png';
//ELEMENTOS
var humanConLabel=Titanium.UI.createLabel({
    text:'Humanidades y Ciencias de la Conducta',
    backgroundlColor: 'transparent',
	width:'125',
	height:'auto',
	font:{fontSize:10, fontFamily:'AppleGothic'},
    	textAlign:'center'	
});
var humanCon = Titanium.UI.createButtonBar({
   	style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
	backgroundColor:'#C0C0C0',
    labels:[''],
	top:310,	
	left:0,
    height:26,
    width:155
});
humanCon.add(humanConLabel);
var socialesLabel=Titanium.UI.createLabel({
    text:'Ciencias Sociales',
    backgroundlColor: 'transparent',
	width:'125',
	height:'auto',
	font:{fontSize:13, fontFamily:'AppleGothic'},
    	textAlign:'center'	
});
var sociales = Titanium.UI.createButtonBar({
 	style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
	backgroundColor:'#C0C0C0',
    labels:[''],
	top:343,	
	left:0,
    height:26,
    width:155	
});
sociales.add(socialesLabel);
var economicasLabel=Titanium.UI.createLabel({
    text:'Ciencias Economicas',
    backgroundlColor: 'transparent',
	width:'125',
	height:'auto',
	font:{fontSize:13, fontFamily:'AppleGothic'},
    	textAlign:'center'	
});
var economicas = Titanium.UI.createButtonBar({
	style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
	backgroundColor:'#C0C0C0',
    labels:[''],
	top:376,	
	left:0,
    height:26,
    width:155	
});
economicas.add(economicasLabel);
var ingenieriaLabel=Titanium.UI.createLabel({
    text:'Ingenieria e Industria',
    backgroundlColor: 'transparent',
	width:'125',
	height:'auto',
	font:{fontSize:13, fontFamily:'AppleGothic'},
    	textAlign:'center'	
});
var ingenieria = Titanium.UI.createButtonBar({
	style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
	backgroundColor:'#C0C0C0',
    labels:[''],
	top:409,	
	left:0,
    height:26,
    width:155
});
ingenieria.add(ingenieriaLabel);
var bcloseLabel=Titanium.UI.createLabel({
    text:'Menu',
    backgroundlColor: 'transparent',
	width:'125',
	height:'auto',
	font:{fontSize:13, fontFamily:'AppleGothic'},
    	textAlign:'center'	
});
var bclose = Titanium.UI.createButtonBar({
	style:Titanium.UI.iPhone.SystemButtonStyle.BAR,
	backgroundColor:'#C0C0C0',
    labels:[''],
	top:277,	
	left:0,
    height:26,
    width:155
}); 
bclose.add(bcloseLabel);
//añade botones a la ventana
win.add(humanCon);
win.add(sociales);
win.add(economicas);
win.add(ingenieria);
win.add(bclose);

//EVENTOS
humanCon.addEventListener('click',function (e){
	Titanium.API.info("Humanidades y conducta ... clicked");
	var humanCon = Titanium.UI.createWindow({
		url:'./humanidades/appHumanCon.js'
	});
	humanCon.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
});
sociales.addEventListener('click',function (e){
	Titanium.API.info("Ciencias Sociales ... clicked");
	var humanCon = Titanium.UI.createWindow({
		url:'./sociales/appSociales.js'
	});
	humanCon.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
});
economicas.addEventListener('click',function (e){
	Titanium.API.info("Ciencias Sociales ... clicked");
	var humanCon = Titanium.UI.createWindow({
		url:'./economicas/appEconomicas.js'
	});
	humanCon.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
});
ingenieria.addEventListener('click',function (e){
	Titanium.API.info("Ciencias Sociales ... clicked");
	var humanCon = Titanium.UI.createWindow({
		url:'./ingenieria/appIngenieria.js'
	});
	humanCon.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_UP});
});
bclose.addEventListener('click', function(e) {
  Titanium.API.info("ventana de licenciaturas cerrada");
  var Menu = Titanium.UI.createWindow({
  	url:'../ModMenu/appMenu.js'
  });
  Menu.open({transition:Ti.UI.iPhone.AnimationStyle.CURL_DOWN});
});

